'use strict';

let cheerio = require('cheerio');
let http = require('http');
let iconv = require('iconv-lite');
let request = require('request');

const url = 'http://www.zhongzidi.com';

module.exports=function (req,res){
    let params=req.params();

    console.log(param);

    let html = request('GET', url).getBody().toString();
    console.log(html);

    let $ = cheerio.load(html);
    $('tbody').each(
        function(i,elem){
       console.log(i+":"+elem);
    });

    //
    // var movieName = $('#content>h1>span').filter(function(i,el){
    //     return $(this).attr('property') === 'v:itemreviewed';
    // }).text();
    //
    // let log4js = require('log4js');
    // let logger = log4js.getLogger();
    // logger.debug("Time:", new Date());
    res.send('调用成功');
};